<template>
	<view class="content">
		<z-paging ref="paging" v-model="dataList" @query="queryList">
			<view class="item" v-for="(item,index) in dataList" :key="index" @click="itemClick(item,index)">
				<view class="item-list" style="display: flex; width: 100%;">
					<view class="item-title" style="width: 30%;">
						<view class="Imagebox">
							<image class="Image" 
							:src="item.vod_pic"
							mode="aspectFill"
							></image>
						
							<view class="topvip" v-if="item.videotype===1">
								<text class="top-text">VIP</text>
							</view>
							
							<view class="bottom">
								<text class="bottom-text">{{item.vod_remarks}}</text>
							</view>
						</view>
					</view>
					<view class="item-detail" style="width: 70%;">
						<view class="title" style="font-size: larger;color: #303133;margin-bottom: 20rpx;">
							{{item.vod_name}}
						</view>
						<view class="title">
							类型：{{item.vod_class}}
						</view>
						<view class="title">
							演员：{{item.vod_actor}}
						</view>
						<view class="title">
							描述：{{item.vod_blurb}}
						</view>
						<u-button class="bt" type="primary"  @click="itemClick(item)">立即播放</u-button>
					</view>
				</view>
				<view class="item-line"></view>
			</view>
		</z-paging>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList: [],
				tabIndex: 0,
				data:[
					
				]
			}
		},
		methods: {
			queryList(pageNo, pageSize) {
				//组件加载时会自动触发此方法，因此默认页面加载时会自动触发，无需手动调用
				//这里的pageNo和pageSize会自动计算好，直接传给服务器即可
				//模拟请求服务器获取分页数据，请替换成自己的网络请求
				const params = {
					pageNo: pageNo,
					pageSize: pageSize,
					type: this.tabIndex + 1
				}
				this.$refs.paging.complete(this.data);
				// this.$request.queryList(params).then(res => {
				// 	//将请求的结果数组传递给z-paging
				// 	this.$refs.paging.complete(res.data.list);
				// }).catch(res => {
				// 	//如果请求失败写this.$refs.paging.complete(false);
				// 	//注意，每次都需要在catch中写这句话很麻烦，z-paging提供了方案可以全局统一处理
				// 	//在底层的网络请求抛出异常时，写uni.$emit('z-paging-error-emit');即可
				// 	this.$refs.paging.complete(false);
				// })
			},
			itemClick(item, index) {
				console.log('点击了', item.title);
			}
		}
	}
</script>

<style>

</style>
